﻿#ifndef MYSERVER_H
#define MYSERVER_H

#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QTimer>

class MyServer : public QObject
{
    Q_OBJECT
public:
    MyServer();
    bool start();
    void stop();
    void send(QString msg);

private:
    QTcpServer server;
    QList<QTcpSocket *> sockets;
    bool bReady[100];
    QTimer *timer;

private slots:
    void incomingConnection();
    void socketDisconnected();
    void readyRead();
    void onTimer();

};

#endif // MYSERVER_H
